<%@ Page Language="C#" AutoEventWireup="true" CodeFile="New.aspx.cs" Inherits="Calendar_New" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>New Event</title>
    <link href='../Media/empty.css' rel="stylesheet" /> 

    <script src="../Js/jquery.7.1.js"></script>
 <style type="text/css">
     
 .newappointment
 {

 	}
 	.newappointmentText
 	{}
 .txtFrom
 {}
 </style>
 
    <script>
    function Concatenateercent()
{
    var discValue = document.getElementById('TextBoxName').value;
    if(discValue.indexOf('%') == -1)
    {
        document.getElementById('TextBoxName').value = document.getElementById('TextBoxName').value + "%";
    }
}
function SetToDate()
{
    var startDate = document.getElementById("TextBoxStart").value;
    var splitStartDate = startDate.split(' ');
    document.getElementById("TextBoxEnd").value = splitStartDate[0] + " 07:00:00 PM";
    if(document.getElementById("TextBoxEnd").disabled == false && document.getElementById("TextBoxEnd").readOnly == false)
    {
//        document.getElementById("TextBoxEnd").disabled = true;
        document.getElementById("TextBoxEnd").readOnly = true;
    }
    else
    {
//        document.getElementById("TextBoxEnd").disabled = false;
        document.getElementById("TextBoxEnd").readOnly = false;
        var hours = splitStartDate[1].split(":");
        var onlYhour =parseInt(hours[0]);
        if(onlYhour != 7)
        { onlYhour = 07;}
        
        document.getElementById("TextBoxEnd").value = splitStartDate[0] + " "+ onlYhour + ":00:00 " + splitStartDate[2];   
    }
}
    </script>
    
</head>
<body style="background-color:white; margin:10px;">
    <form id="form1" runat="server">
    <div>
        <table border="0" cellspacing="4" cellpadding="0">
            <tr>
                 <td colspan="2" class="page-heading"  style=" font-size:20px; padding-left:30px; padding-bottom:10px;">
                 New Appointment 
                </td>
            </tr>
            <tr>
                <td align="right">From:</td>
                <td><asp:TextBox ID="TextBoxStart" CssClass="txtFrom" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
                <td align="right">To:</td>
                <td><asp:TextBox ID="TextBoxEnd" CssClass="newappointmentText" runat="server"></asp:TextBox>
               
                </td>
            </tr>
            
            <%--<tr>
            <td align="right">All the day:</td>
            <td>
            <table>
            <tr>
            <td align="right">
                <asp:CheckBox ID="CheckBox1" onclick="SetToDate()" CssClass="newappointment" runat="server" Text="" />
                </td>
               
            </tr>
            </table>
            </td>
                
                
            </tr>--%>
            <tr>
                <td align="right">Discount:</td>
                <td><asp:TextBox ID="TextBoxName" Text="60%" onblur="Concatenateercent();" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
                <td align="right"></td>
                <td>
                    <asp:Label ID="lblMessage" ForeColor="Red" runat="server" Text="" Visible="false"></asp:Label>
               </td>
            </tr
            <tr>
                <td align="right"></td>
                <td>
                
                    <asp:Button ID="ButtonOK" runat="server" OnClick="ButtonOK_Click" Text="OK" />
                    <asp:Button ID="ButtonCancel" runat="server" Text="Cancel" OnClick="ButtonCancel_Click" />
                </td>
            </tr>
            
        </table>
        
        </div>
    </form>
</body>
</html>
